package com.common.retrofit.methods;

import com.common.bean.OrderDetailsBean;
import com.common.bean.OrderListBean;
import com.common.retrofit.base.BaseMethods;
import com.common.retrofit.service.HaiNingService;

import rx.Observable;
import rx.Subscriber;

public class OrderDetailsMethods extends BaseMethods {

    private static OrderDetailsMethods m_ins = null;

    public static OrderDetailsMethods getInstance() {
        if (m_ins == null) {
            synchronized (OrderDetailsMethods.class) {
                if (m_ins == null) {
                    m_ins = new OrderDetailsMethods();
                }
            }
        }
        return m_ins;
    }

    @Override
    protected String getHttpUrl() {
            return "Order/";
    }

    private HaiNingService initService() {
        return getRetrofit().create(HaiNingService.class);
    }

    // 获取首页数据
    public void orderDetail(Subscriber<OrderDetailsBean> subscriber, int uid, String hashid ,String orderId) {  // type 类型 1未开票 2已开票 Int类型 必填)
        Observable observable = initService().orderDetail(System.currentTimeMillis()+"",
                "d7d64bd6ee14f8b6030680fa9d9acc72",uid,hashid, orderId);
        toSubscribe(observable, subscriber);
    }
}
